settings = {
    // zoomed size relative to the container element
    // 0.0-1.0
    targetsize: .1,
    // animation duration
    duration: 450,
    // easing of animation, similar to css transition params
    // "linear"|"ease"|"ease-in"|"ease-out"|"ease-in-out"|[p1,p2,p3,p4]
    // [p1,p2,p3,p4] refer to cubic-bezier curve params
    easing: "ease",
    root: $("#searchMap")
}

settings2 = {
    // zoomed size relative to the container element
    // 0.0-1.0
    targetsize: .2,
    // animation duration
    duration: 450,
    // easing of animation, similar to css transition params
    // "linear"|"ease"|"ease-in"|"ease-out"|"ease-in-out"|[p1,p2,p3,p4]
    // [p1,p2,p3,p4] refer to cubic-bezier curve params
    easing: "ease",
    root: $("#searchMap")
}

$("#searchBtn").click(function (evt) {

    $("#dashboard").hide();
    $("#searchResultsContainer").show("drop", { direction: "right" }, 500);
    zoomToSeat('Kamote Stone');
    $(".result").removeClass('chosenResult');
    $("#resultsBox .result:first").addClass('chosenResult');
    evt.stopPropagation();


});

$(".result").click(function (evt) {
    $(".result").removeClass('chosenResult');
    $(this).addClass('chosenResult');
    var name = $(this).children('span').text();
    zoomToSeat(name);
    evt.stopPropagation();

});

//$(".seatColumn").click(function (evt) {

//    $(this).zoomTo(settings2);
//});

$("#unzoom").click(function (evt) {
    var name = $(this).children('span').text();
    zoomOut();
    evt.stopPropagation();

});

$('#searchMap').dragscrollable({ dragSelector: '#searchMap:first' });

$('#searchMap').kinetic();

$("#closeSearchBtn").click(function (evt) {

    $("#searchResultsContainer").hide("drop", { direction: "right" }, 500);
    $("#dashboard").show("drop", { direction: "right" }, 500);
   
});


//zooms to seat
function zoomToSeat(empName) {
    $(".seat").removeClass('chosenSeat');

    $("#searchMap").addClass('visibleFlow');
    $(".seat .resource:contains(" + empName + ")").parent('.seat').addClass('chosenSeat').zoomTo(settings2);

}

function zoomOut() {
    $("#searchMap").removeClass('visibleFlow');
    $("#searchMap").zoomTo(settings);


}

function chooseResult(element) {


}


